<template>
  <div class="pie-echart">
    <BaseEchart :options="options"></BaseEchart>
  </div>
</template>

<script setup lang="ts">
// @ts-ignore
import BaseEchart from './BaseEchart.vue'
// 传入配置定制化内容
import type { EChartsOption } from 'echarts'
const options: EChartsOption = {
  tooltip: {
    trigger: 'item'
  },
  legend: {
    top: '5%',
    left: 'center',
    // doesn't perfectly work with our tricks, disable it
    selectedMode: false
  },
  series: [
    {
      top: '20%',
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        },
        labelLine: {
          lineStyle: {
            color: 'rgb(255,0,0)'
          }
        },
        label: {
          color: 'rgb(255,0,0)'
        }
      }
    }
  ]
}
</script>

<style lang="scss" scoped>
.pie-echart {
  height: 400px;
  padding: 10px 15px;
}
</style>
